package com.elab.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;

@Controller
@RequestMapping(value = {"demo", "d", "/api"})
@Api("swaggerDemoController相关的api")
public class demoController {

	@ApiOperation(value = "测试接口是否可用", notes = "测试接口是否可用")
	@ResponseBody
	@RequestMapping(value = {"demo"})
	String demo () {
		return "hello, Emoker";
	}

	@ApiOperation(value = "根据id查询blog", notes = "查询数据库中某个blog信息")
	@ApiImplicitParam(name = "id", value = "blog ID", paramType = "path", required = true, dataType = "Integer")
	@ResponseBody
	@RequestMapping("/blog/{id}")
	public String getBlogById(@PathVariable long id) {
		return "this is blog "+id;
	}

	
}
